1. Field of the Invention
The present invention is related to streaming service systems and methods, and more particularly to a multi-task system and a method for tuning a service performance of the same.
2. The Related Art
As technology improves, a mobile phone tends to equip with an ever increasing number of functions. For example, in addition to making or receiving a call, a mobile phone may function as a multimedia player, a camera, an organizer, or even as a web-surfing machine. With those multi-applications, the mobile phone usually utilizes a multi-task processing core to handle those various functions.
Since system resources, such as computing capacity, of mobile phones are usually very limited, to control multi-functions executed at the same time, the multi-task processing core needs to prioritize each task of the multi-functions. Often a real-time multimedia streaming service has a higher priority than other tasks. When a multi-task handheld device transmits multimedia streams into a network, the real-time multimedia streaming service adjusts the transmission bit rate according to the network bandwidth. For example, when the network bandwidth is unstable, the real-time multimedia streaming service decreases a transmission bit rate to retain a quality of service (QoS). If the network bandwidth is stable and sufficient, the real-time multimedia streaming service increases the transmission bit rate to provide a better multimedia quality of service, at expenses of an increased processing time and a lower QoS of any other low priority task. As a result, the low-priority task might not be executed on schedule.
FIG. 1 shows a timing diagram of a typical multi-task system. Suppose a multi-task system has a first task and a second task to be executed, where the first task is a real-time task and is required to be completed in M time period. The second task is not a real-time task and is of a long working duration. Typically, the multi-task system runs the first task and the second task with different threads, to ensure the two tasks thereof may be executed within M time period. In FIG. 1, four threads A, B, C, and D with priorities ranked as A>B>C>D are presented, where thread A indicates an interrupt service routine (ISR) task executed once every M time periods, which can be used to control the task assignment of the threads B and C. In this embodiment, the threads A, B, and C are considered as a first task and the thread D, with the lowest priority, is considered as a second task. In FIG. 1, the first task occupies unlimited resources, and thus the executing of the second task is influenced. For example, from time scale 2M to 3M, only few processing time is left for the second task. The situation is more severe when the first task is a source/channel encoding and the second task is a non real-time task, such as a file transferring.
FIG. 2 shows a timing diagram of a multi-task streaming service system executing multi-task. The threads A, B, and C are considered as a first task and the thread D, with the lowest priority, is considered as a second task. The first task is a source/channel encoding process in the embodiment. Threads A, B, and C are all required to complete the first task in M time period. During time scale 0 to M, the multi-task system assigns an initialized encoding bit rate according to multimedia source content. The initialized encoding bit rate may be different by application, hence the exact value is not show here. The first task is done within M period, and the rest of time is used to executing thread D. The first task is completed in M time period, which indicates that the real-time constraint of the first task is satisfied. Thus the encoding bit rate is increased in time units M to 2M to improve the quality at the end user. The encoding bit rate is further increased in time units 2M to 3M since that the first task can be done by 2M time unit. During time units 3M to 4M, the first task is not completed in previous M time period, in other words, the encoding bit rate is too high to satisfy the real-time requirement. Therefore, the encoding bit rate is reduced from time units 3M to 4M. Beyond 4M time units, the encoding bit rate is retained if the network quality is stable. FIG. 2 shows that the processing time of the multi-task streaming service is proportional to the streaming bit rate, threads A, B and C, occupying all processing time and considerably delaying tasks with low priority, for example, no processing time is designated to thread D after M time units.
For multi-task systems with limited processor computing power, such as handset or a PDA, when playing multimedia files via an external playing device through wired or wireless channels, such as Bluetooth, GPRS, Wi-Fi, decreasing service quality of low priority threads results in retarding the man machine interface, freezing frames of image decoding and postponing file transfer.